﻿using System;
using System.Collections.Generic;
using System.Data.OleDb;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class show : System.Web.UI.Page
{
    public string b;
    protected void Page_Load(object sender, EventArgs e)
    {
      
        if (!IsPostBack)
        {
            int a = int.Parse(Request.QueryString["name"]);
            if (a == 1)
            {
                b = "课堂教学活动";
            }
            else if (a == 2)
            {
                b = "课内教学条件";
            }
            else if (a == 3)
            {
                b = "田径裁判培训";
            }
            else if (a == 4)
            {
                b = "校外实习基地";
            }
            else if (a == 5)
            {
                b = "田径理论教学录像";
            }
            else if (a == 6)
            {
                b = "跨栏跑教学录像";
            }
            else if (a == 7)
            {
                b = "跳高课教学录像";
            }
            else if (a == 8)
            {
                b = "野外生存理论录像";
            }
        }
        //int c = int.Parse(Request.QueryString["id"]);
        string strConnection = "Provider=Microsoft.Jet.OleDb.4.0 ;Data Source=|DataDirectory|\\web.mdb";
        OleDbConnection objConnection = new OleDbConnection(strConnection);
        objConnection.Open();
        string sql = "select * from news where shenhe='已审核'and bumen='" + b + "' order by id desc";
        OleDbCommand cmd = new OleDbCommand(sql, objConnection);
        OleDbDataReader reader = cmd.ExecuteReader();
        if (reader.Read())//从数据库读取用户信息
        {
            string q, w, r, y, u, l, k;
            q = reader["timu"].ToString();
            w = reader["time1"].ToString();
            r = reader["bumen"].ToString();
            y = reader["lanmu"].ToString();
            l = reader["name1"].ToString();
            int t = int.Parse(reader["cishu"].ToString());
            k = reader["shenhe"].ToString();
            u = reader["zw"].ToString();
            Label1.Text = q.Trim(); Label2.Text = u.Trim();      
        }
        reader.Close();
        objConnection.Close();
    }
}
